package com.learn.ch02ttlqueue.other;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author DJJ_F
 * @version 1.0
 * @date 2025/08/27
 * @description ch09 other
 */
@Component
@Slf4j
public class Consumer {
    @RabbitListener(queues = "queueOther")
    public void receive(Message message) {
        System.out.println("收到消息：" + new String(message.getBody()) +
                "，优先级：" +
                message.getMessageProperties().getPriority());

    }
}
